package com.ruoyi.good.service;

import com.ruoyi.good.model.entity.GoodSkuEntity;
import com.ruoyi.good.model.vo.GoodSkuStockKeyVO;

import java.util.Date;

/**
 * TODO
 *
 * @Description
 * @Author wkm
 * @Date 2024/12/29
 **/
public interface ISkuStock {


 boolean assembleGoodSku(Long goodsId);

 public GoodSkuStockKeyVO takeQueueValue() throws InterruptedException;

 /**
  * 清空队列
  */
 void clearQueueValue();

 /**
  * 延迟队列 + 任务趋势更新库存
  *
  * @param goodsId 商品Id
  */
 void updateGoodSkuStock(Long goodsId);

 /**
  * 缓存库存以消耗完毕，清空数据库库存
  *
  * @param goodsId 商品Id
  */
 void clearGoodSkuStock(Long goodsId);


 boolean subtractionGoodSkuStock(Long goodsId, Date endDateTime);

  boolean action(Long goodsId);

}
